﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CodePlex.SpaceBlock.FS;
using CodePlex.Resourceful.Amazon.S3;
using CodePlex.Resourceful;

namespace CodePlex.SpaceBlock.Test35
{
    public static class Program
    {

        public static void Main(string[] args)
        {

            string[] aws = Environment.GetEnvironmentVariable("AWS").Split(':');

            string accessKeyID = aws[0];
            string secretAccessKey = aws[1];

            S3Connection cn = new S3Connection(accessKeyID, secretAccessKey, false, RequestStyle.Path);

            S3FileSystem s3fs = new S3FileSystem(cn);

            foreach (var f in s3fs.GetFolders(Path.Root).OrderByDescending(f=>f.LastModified))
            {
                Console.WriteLine("{1}\t{0}", f.Path.Name, f.LastModified);
            }

            Console.ReadKey();

        }


       

    }
}
